package recycle.config;

import io.vertx.core.Vertx;
import io.vertx.mysqlclient.MySQLConnectOptions;
import io.vertx.mysqlclient.MySQLPool;
import io.vertx.sqlclient.PoolOptions;

public class DatabaseConfig {
    public static MySQLPool getMySQLPool(Vertx vertx) {
        MySQLConnectOptions connectOptions = new MySQLConnectOptions()
            .setHost("localhost")
            .setPort(3306)
            .setDatabase("vertx_recycle")
            .setUser("root")
            .setPassword("root");

        PoolOptions poolOptions = new PoolOptions().setMaxSize(10);
        return MySQLPool.pool(vertx, connectOptions, poolOptions);
    }
}